'use strict';
/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, middleware } = app;

  // 用户
  router.post('/api/upload/file', controller.uploadcos.file);
  // 企业申请列表
  // 登录
  router.get('/api/sendCode', controller.user.sendCode);
  router.get('/api/user/list', controller.user.allList);
  router.post('/api/user/login', controller.user.login);
  // 注册
  router.post('/api/user/register', controller.user.create);
  router.resources('user', '/api/user', controller.user);
  // 城市
    router.get('/api/city/list', controller.city.allList);
    router.resources('city', '/api/city', controller.city);
    // 类型
    router.get('/api/category/list', controller.category.allList);
    router.resources('category', '/api/category', controller.category);
    // 职位类型
    router.get('/api/postCategory/list', controller.postCategory.allList);
    router.resources('postCategory', '/api/postCategory', controller.postCategory);
    // 职位
  router.get('/api/post/list', controller.post.allList);
    router.put('/api/post/sort/:id', controller.post.sort);
    router.resources('post', '/api/post', controller.post);
    // 充值配置
    router.get('/api/rechargeConfig/list', controller.rechargeConfig.allList);
    router.resources('rechargeConfig', '/api/rechargeConfig', controller.rechargeConfig);
    // 消费记录
    router.resources('recharge', '/api/recharge', controller.recharge);
    // 文件
    router.get('/api/companyFile/list', controller.companyFile.allList);
    router.resources('companyFile', '/api/companyFile', controller.companyFile);
    // 职位申请
    router.get('/api/postJoin/list', controller.postJoin.allList);
    router.resources('postJoin', '/api/postJoin', controller.postJoin);
    // 简历
    router.get('/api/resume/user', controller.resume.user);
    router.get('/api/resume/list', controller.resume.allList);
    router.resources('resume', '/api/resume', controller.resume);

    router.post('/api/company/login', controller.user.companyLogin);
    router.post('/api/company/register', controller.user.create);


  // policy
  router.get('/api/policy/list', controller.policy.allList);
  router.resources('policy', '/api/policy', controller.policy);

};
